<?php

/**
 * SeanceStage form.
 *
 * @package    tfe
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class SeanceStageForm extends BaseSeanceStageForm {
    /**
     * @see EvenementForm
     */
    public function configure() {
        parent::configure();
        unset($this['type']);
        unset($this['created_at'], $this['updated_at'], $this['deleted_at'],
                $this['type'],$this['id_spectacle'],$this['id_stage'], $this['id_location'],
                $this['prix_reservation'], $this['prix_sur_place'], $this['prix_jeunes'], $this['prix_membres']);

        $dateWidget = new sfWidgetFormI18nDate(array(
                        'format' => '%day%/%month%/%year%',
                        'culture'=>'fr'
        ));
        $this->widgetSchema['date'] = new sfWidgetFormJqueryDate(array(
                        'date_widget' => $dateWidget,
                        'culture'=>'fr_FR'
        ));

        $this->widgetSchema['id_stage'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Stage'), 'add_empty' => false));
        $this->widgetSchema['id_stage']->setOption('renderer_class', 'sfWidgetFormDoctrineJQueryAutocompleter');
        $this->widgetSchema['id_stage']->setOption('renderer_options', array(
                'model' => 'Stage',
                'url'   => '/stage/autocomplete',
        ));
    }
}
